<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html lang="en">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<meta name="generator" content="PHPDoctor 2RC4 (http://peej.github.com/phpdoctor/)">
<meta name="when" content="Fri, 23 Jul 2010 20:16:23 +0000">

<link rel="stylesheet" type="text/css" href="../stylesheet.css">
<link rel="start" href="../overview-summary.html">

<title>HR_hostingaccountApi.class.php (Hosting Reborn API PHP Library)</title>

</head>
<body id="file" onload="parent.document.title=document.title;">

<div class="header">
<h1>Hosting Reborn API PHP Library</h1>
<ul>
<li><a href="../overview-summary.html">Overview</a></li>
<li>Package</li><li>Class</li><li>Tree</li><li><a href="../overview-files.html">Files</a></li>
<li><a href="../deprecated-list.html">Deprecated</a></li>
<li><a href="../index-all.html">Index</a></li>
</ul>
</div>

<div class="small_links">
<a href="../index.html" target="_top">Frames</a>
<a href="../source/hr_hostingaccountapi.class.php.html" target="_top">No frames</a>
</div>
<hr>

<h1>HR_hostingaccountApi.class.php</h1>
<hr>

<a name="line1"></a><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<a name="line2"></a><span style="color: #009933; font-style: italic;">/** An interface to the Hosting Reborn API hosting account functions.
<a name="line3"></a> * @package com\hostingreborn\api
<a name="line4"></a> * @link https//api.hostingreborn.com/docs/functions/hostingaccount/
<a name="line5"></a> *
<a name="line6"></a> * @author      Jon Cram &lt;jon@hostingreborn.com&gt;
<a name="line7"></a> * @copyright   https://api.hostingreborn.com/code/copyright/
<a name="line8"></a> * @license     https://api.hostingreborn.com/code/license/
<a name="line9"></a> * @version     1.0
<a name="line10"></a> *
<a name="line11"></a> * $Date: 2010/07/04 22:51:02 $
<a name="line12"></a> * $Revision: 2c423d307a13 $
<a name="line13"></a> *
<a name="line14"></a> *
<a name="line15"></a> */</span>
<a name="line16"></a>&nbsp;
<a name="line17"></a><span style="color: #b1b100;">require_once</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'HR_api.class.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a name="line18"></a>&nbsp;
<a name="line19"></a><span style="color: #000000; font-weight: bold;">class</span> HR_hostingaccountApi <span style="color: #000000; font-weight: bold;">extends</span> HR_api <span style="color: #009900;">&#123;</span>
<a name="line20"></a>&nbsp;
<a name="line21"></a>    <span style="color: #666666; font-style: italic;">/***************************************************************************/</span>
<a name="line22"></a>    <span style="color: #666666; font-style: italic;">/* Attributes                                                              */</span>
<a name="line23"></a>    <span style="color: #666666; font-style: italic;">/***************************************************************************/</span>
<a name="line24"></a>&nbsp;
<a name="line25"></a>    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000088;">$hostingAccountCollectionProperties</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span>
<a name="line26"></a>            <span style="color: #0000ff;">'/hostingaccount/domain'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'domain'</span><span style="color: #339933;">,</span>
<a name="line27"></a>            <span style="color: #0000ff;">'/hostingaccount/username'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'username'</span><span style="color: #339933;">,</span>
<a name="line28"></a>            <span style="color: #0000ff;">'/hostingaccount/owner'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'owner'</span><span style="color: #339933;">,</span>
<a name="line29"></a>            <span style="color: #0000ff;">'/hostingaccount/creationtime'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'creationtime'</span><span style="color: #339933;">,</span>
<a name="line30"></a>            <span style="color: #0000ff;">'/hostingaccount/serverip'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'serverip'</span><span style="color: #339933;">,</span>
<a name="line31"></a>            <span style="color: #0000ff;">'/hostingaccount/storagelimit'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'storagelimit'</span><span style="color: #339933;">,</span>
<a name="line32"></a>            <span style="color: #0000ff;">'/hostingaccount/bandwidthlimit'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'bandwidthlimit'</span><span style="color: #339933;">,</span>
<a name="line33"></a>            <span style="color: #0000ff;">'/hostingaccount/storageusage'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'storageusage'</span><span style="color: #339933;">,</span>
<a name="line34"></a>            <span style="color: #0000ff;">'/hostingaccount/bandwidthusage'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'bandwidthusage'</span><span style="color: #339933;">,</span>
<a name="line35"></a>            <span style="color: #0000ff;">'/hostingaccount/storagecost'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'storagecost'</span><span style="color: #339933;">,</span>
<a name="line36"></a>            <span style="color: #0000ff;">'/hostingaccount/bandwidthcost'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'bandwidthcost'</span><span style="color: #339933;">,</span>
<a name="line37"></a>            <span style="color: #0000ff;">'/hostingaccount/status'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'status'</span><span style="color: #339933;">,</span>
<a name="line38"></a>            <span style="color: #0000ff;">'/hostingaccount/suspendedby'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'suspendedby'</span><span style="color: #339933;">,</span>
<a name="line39"></a>            <span style="color: #0000ff;">'/hostingaccount/suspensioncategory'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'suspensioncategory'</span><span style="color: #339933;">,</span>
<a name="line40"></a>            <span style="color: #0000ff;">'/hostingaccount/suspensionreason'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'suspensionreason'</span>
<a name="line41"></a>    <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a name="line42"></a>&nbsp;
<a name="line43"></a>    <span style="color: #666666; font-style: italic;">/***************************************************************************/</span>
<a name="line44"></a>    <span style="color: #666666; font-style: italic;">/* Constructors                                                            */</span>
<a name="line45"></a>    <span style="color: #666666; font-style: italic;">/***************************************************************************/</span>
<a name="line46"></a>&nbsp;
<a name="line47"></a>    <span style="color: #666666; font-style: italic;">/***************************************************************************/</span>
<a name="line48"></a>    <span style="color: #666666; font-style: italic;">/* Public methods                                                          */</span>
<a name="line49"></a>    <span style="color: #666666; font-style: italic;">/***************************************************************************/</span>
<a name="line50"></a>&nbsp;
<a name="line51"></a>&nbsp;
<a name="line52"></a>    <span style="color: #009933; font-style: italic;">/**
<a name="line53"></a>     * @link http://api.hostingreborn.com/docs/functions/hostingaccount/
<a name="line54"></a>     *
<a name="line55"></a>     * @param string $key
<a name="line56"></a>     * @param string $domain
<a name="line57"></a>     * @param string $email
<a name="line58"></a>     * @return array
<a name="line59"></a>     */</span>
<a name="line60"></a>    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> get<span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">NULL</span><span style="color: #339933;">,</span> <span style="color: #000088;">$domain</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">NULL</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<a name="line61"></a>        <span style="color: #666666; font-style: italic;">/*
<a name="line62"></a>            Exceptions thrown by API:
<a name="line63"></a>                - database (handled internally by API)
<a name="line64"></a>                - system (handled internally by API)
<a name="line65"></a>        */</span>
<a name="line66"></a>&nbsp;
<a name="line67"></a>        <span style="color: #000088;">$fullArgumentList</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/func_get_args"><span style="color: #990000;">func_get_args</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a name="line68"></a>&nbsp;
<a name="line69"></a>        <span style="color: #000088;">$standardArguments</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span>
<a name="line70"></a>                <span style="color: #0000ff;">'key'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$key</span><span style="color: #339933;">,</span>
<a name="line71"></a>                <span style="color: #0000ff;">'domain'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$domain</span>
<a name="line72"></a>        <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a name="line73"></a>&nbsp;
<a name="line74"></a>        <span style="color: #000088;">$additionalArguments</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span>
<a name="line75"></a>                <span style="color: #0000ff;">'excludeDeleted'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'true'</span>
<a name="line76"></a>        <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a name="line77"></a>&nbsp;
<a name="line78"></a>        <span style="color: #000088;">$queryString</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">buildQueryString</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$standardArguments</span><span style="color: #339933;">,</span> <span style="color: #000088;">$fullArgumentList</span><span style="color: #339933;">,</span> <span style="color: #000088;">$additionalArguments</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a name="line79"></a>&nbsp;
<a name="line80"></a>        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">read</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'hostingaccount/get/?'</span><span style="color: #339933;">.</span><span style="color: #000088;">$queryString</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getCollection</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">hostingAccountCollectionProperties</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a name="line81"></a>    <span style="color: #009900;">&#125;</span>
<a name="line82"></a>&nbsp;
<a name="line83"></a>&nbsp;
<a name="line84"></a>    <span style="color: #009933; font-style: italic;">/**
<a name="line85"></a>     * http://api.hostingreborn.com/docs/functions/hostingaccount/reset_password/
<a name="line86"></a>     *
<a name="line87"></a>     * @param string $key
<a name="line88"></a>     * @param string $domain
<a name="line89"></a>     * @return string
<a name="line90"></a>     */</span>
<a name="line91"></a>    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> resetPassword<span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">NULL</span><span style="color: #339933;">,</span> <span style="color: #000088;">$domain</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">NULL</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<a name="line92"></a>        <span style="color: #666666; font-style: italic;">/*
<a name="line93"></a>            Exceptions thrown by API:
<a name="line94"></a>                - database (handled internally by API)
<a name="line95"></a>                - system (handled internally by API)
<a name="line96"></a>                - hostingaccount
<a name="line97"></a>                    200: password reset failed
<a name="line98"></a>        */</span>
<a name="line99"></a>&nbsp;
<a name="line100"></a>        <span style="color: #000088;">$arguments</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span>
<a name="line101"></a>                <span style="color: #0000ff;">'key'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$key</span><span style="color: #339933;">,</span>
<a name="line102"></a>                <span style="color: #0000ff;">'domain'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$domain</span><span style="color: #339933;">,</span>
<a name="line103"></a>                <span style="color: #0000ff;">'length'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">8</span>
<a name="line104"></a>        <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a name="line105"></a>&nbsp;
<a name="line106"></a>        try <span style="color: #009900;">&#123;</span>
<a name="line107"></a>            <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">write</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'hostingaccount/reset_password/'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$arguments</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getValue</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/newpassword'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a name="line108"></a>        <span style="color: #009900;">&#125;</span> catch <span style="color: #009900;">&#40;</span>HR_apiResponseUnhandledException <span style="color: #000088;">$e</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<a name="line109"></a>            <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handleApiResponseUnhandledException</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$e</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a name="line110"></a>        <span style="color: #009900;">&#125;</span>
<a name="line111"></a>    <span style="color: #009900;">&#125;</span>
<a name="line112"></a>&nbsp;
<a name="line113"></a>&nbsp;
<a name="line114"></a>    <span style="color: #009933; font-style: italic;">/**
<a name="line115"></a>     * @link http://api.hostingreborn.com/docs/functions/hostingaccount/set_bandwidth_limit/
<a name="line116"></a>     *
<a name="line117"></a>     * @param string $key
<a name="line118"></a>     * @param string $domain
<a name="line119"></a>     * @param int $limit
<a name="line120"></a>     * @return bool
<a name="line121"></a>     */</span>
<a name="line122"></a>    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> setBandwidthLimit<span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">NULL</span><span style="color: #339933;">,</span> <span style="color: #000088;">$domain</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">NULL</span><span style="color: #339933;">,</span> <span style="color: #000088;">$limit</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">NULL</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<a name="line123"></a>        <span style="color: #666666; font-style: italic;">/*
<a name="line124"></a>            Exceptions thrown by API:
<a name="line125"></a>                - database (handled internally by API)
<a name="line126"></a>                - system (handled internally by API)
<a name="line127"></a>        */</span>
<a name="line128"></a>&nbsp;
<a name="line129"></a>        <span style="color: #000088;">$fullArgumentList</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/func_get_args"><span style="color: #990000;">func_get_args</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a name="line130"></a>&nbsp;
<a name="line131"></a>        <span style="color: #000088;">$standardArguments</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span>
<a name="line132"></a>                <span style="color: #0000ff;">'key'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$key</span><span style="color: #339933;">,</span>
<a name="line133"></a>                <span style="color: #0000ff;">'domain'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$domain</span><span style="color: #339933;">,</span>
<a name="line134"></a>                <span style="color: #0000ff;">'limit'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$limit</span>
<a name="line135"></a>        <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a name="line136"></a>&nbsp;
<a name="line137"></a>        <span style="color: #000088;">$arguments</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">buildArguments</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$standardArguments</span><span style="color: #339933;">,</span> <span style="color: #000088;">$fullArgumentList</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a name="line138"></a>&nbsp;
<a name="line139"></a>        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">write</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'hostingaccount/set_bandwidth_limit/'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$arguments</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">wasSuccessful</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a name="line140"></a>    <span style="color: #009900;">&#125;</span>
<a name="line141"></a>&nbsp;
<a name="line142"></a>&nbsp;
<a name="line143"></a>    <span style="color: #009933; font-style: italic;">/**
<a name="line144"></a>     * @link http://api.hostingreborn.com/docs/functions/hostingaccount/set_storage_limit/
<a name="line145"></a>     *
<a name="line146"></a>     * @param string $key
<a name="line147"></a>     * @param string $domain
<a name="line148"></a>     * @param int $limit
<a name="line149"></a>     * @return bool
<a name="line150"></a>     */</span>
<a name="line151"></a>    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> setStorageLimit<span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">NULL</span><span style="color: #339933;">,</span> <span style="color: #000088;">$domain</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">NULL</span><span style="color: #339933;">,</span> <span style="color: #000088;">$limit</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">NULL</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<a name="line152"></a>        <span style="color: #666666; font-style: italic;">/*
<a name="line153"></a>            Exceptions thrown by API:
<a name="line154"></a>                - database (handled internally by API)
<a name="line155"></a>                - system (handled internally by API)
<a name="line156"></a>        */</span>
<a name="line157"></a>&nbsp;
<a name="line158"></a>        <span style="color: #000088;">$fullArgumentList</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/func_get_args"><span style="color: #990000;">func_get_args</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a name="line159"></a>&nbsp;
<a name="line160"></a>        <span style="color: #000088;">$standardArguments</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span>
<a name="line161"></a>                <span style="color: #0000ff;">'key'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$key</span><span style="color: #339933;">,</span>
<a name="line162"></a>                <span style="color: #0000ff;">'domain'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$domain</span><span style="color: #339933;">,</span>
<a name="line163"></a>                <span style="color: #0000ff;">'limit'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$limit</span>
<a name="line164"></a>        <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a name="line165"></a>&nbsp;
<a name="line166"></a>        <span style="color: #000088;">$arguments</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">buildArguments</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$standardArguments</span><span style="color: #339933;">,</span> <span style="color: #000088;">$fullArgumentList</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a name="line167"></a>&nbsp;
<a name="line168"></a>        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">write</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'hostingaccount/set_storage_limit/'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$arguments</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">wasSuccessful</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a name="line169"></a>    <span style="color: #009900;">&#125;</span>
<a name="line170"></a>&nbsp;
<a name="line171"></a>&nbsp;
<a name="line172"></a>    <span style="color: #009933; font-style: italic;">/**
<a name="line173"></a>     * @link http://api.hostingreborn.com/docs/functions/hostingaccount/suspend/
<a name="line174"></a>     *
<a name="line175"></a>     * @param string $key
<a name="line176"></a>     * @param string $domain
<a name="line177"></a>     * @param string $reason
<a name="line178"></a>     * @return bool
<a name="line179"></a>     */</span>
<a name="line180"></a>    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> suspend<span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">NULL</span><span style="color: #339933;">,</span> <span style="color: #000088;">$domain</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">NULL</span><span style="color: #339933;">,</span> <span style="color: #000088;">$reason</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">NULL</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<a name="line181"></a>        <span style="color: #666666; font-style: italic;">/*
<a name="line182"></a>            Exceptions thrown by API:
<a name="line183"></a>                - database (handled internally by API)
<a name="line184"></a>                - system (handled internally by API)
<a name="line185"></a>        */</span>
<a name="line186"></a>&nbsp;
<a name="line187"></a>        <span style="color: #000088;">$fullArgumentList</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/func_get_args"><span style="color: #990000;">func_get_args</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a name="line188"></a>&nbsp;
<a name="line189"></a>        <span style="color: #000088;">$standardArguments</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span>
<a name="line190"></a>                <span style="color: #0000ff;">'key'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$key</span><span style="color: #339933;">,</span>
<a name="line191"></a>                <span style="color: #0000ff;">'domain'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$domain</span><span style="color: #339933;">,</span>
<a name="line192"></a>                <span style="color: #0000ff;">'reason'</span> <span style="color: #339933;">=&gt;</span> <a href="http://www.php.net/stripslashes"><span style="color: #990000;">stripslashes</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$reason</span><span style="color: #009900;">&#41;</span>
<a name="line193"></a>        <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a name="line194"></a>&nbsp;
<a name="line195"></a>        <span style="color: #000088;">$arguments</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">buildArguments</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$standardArguments</span><span style="color: #339933;">,</span> <span style="color: #000088;">$fullArgumentList</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a name="line196"></a>&nbsp;
<a name="line197"></a>        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">write</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'hostingaccount/suspend/'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$arguments</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">wasSuccessful</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a name="line198"></a>    <span style="color: #009900;">&#125;</span>
<a name="line199"></a>&nbsp;
<a name="line200"></a>&nbsp;
<a name="line201"></a>    <span style="color: #009933; font-style: italic;">/**
<a name="line202"></a>     * @link http://api.hostingreborn.com/docs/functions/hostingaccount/unsuspend/
<a name="line203"></a>     *
<a name="line204"></a>     * @param string $key
<a name="line205"></a>     * @param string $domain
<a name="line206"></a>     * @return bool
<a name="line207"></a>     */</span>
<a name="line208"></a>    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> unsuspend<span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">NULL</span><span style="color: #339933;">,</span> <span style="color: #000088;">$domain</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">NULL</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<a name="line209"></a>        <span style="color: #666666; font-style: italic;">/*
<a name="line210"></a>            Exceptions thrown by API:
<a name="line211"></a>                - database (handled internally by API)
<a name="line212"></a>                - system (handled internally by API)
<a name="line213"></a>        */</span>
<a name="line214"></a>&nbsp;
<a name="line215"></a>&nbsp;
<a name="line216"></a>        <span style="color: #000088;">$fullArgumentList</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/func_get_args"><span style="color: #990000;">func_get_args</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a name="line217"></a>&nbsp;
<a name="line218"></a>        <span style="color: #000088;">$standardArguments</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span>
<a name="line219"></a>                <span style="color: #0000ff;">'key'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$key</span><span style="color: #339933;">,</span>
<a name="line220"></a>                <span style="color: #0000ff;">'domain'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$domain</span>
<a name="line221"></a>        <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a name="line222"></a>&nbsp;
<a name="line223"></a>        <span style="color: #000088;">$arguments</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">buildArguments</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$standardArguments</span><span style="color: #339933;">,</span> <span style="color: #000088;">$fullArgumentList</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a name="line224"></a>&nbsp;
<a name="line225"></a>        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">write</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'hostingaccount/unsuspend/'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$arguments</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">wasSuccessful</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a name="line226"></a>    <span style="color: #009900;">&#125;</span>
<a name="line227"></a>&nbsp;
<a name="line228"></a>&nbsp;
<a name="line229"></a>    <span style="color: #009933; font-style: italic;">/**
<a name="line230"></a>     *  @link http://api.hostingreborn.com/docs/functions/hostingaccount/terminate/
<a name="line231"></a>     *
<a name="line232"></a>     * @param string $key
<a name="line233"></a>     * @param string $domain
<a name="line234"></a>     * @return bool
<a name="line235"></a>     */</span>
<a name="line236"></a>    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> terminate<span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">NULL</span><span style="color: #339933;">,</span> <span style="color: #000088;">$domain</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">NULL</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<a name="line237"></a>        <span style="color: #666666; font-style: italic;">/*
<a name="line238"></a>            Exceptions thrown by API:
<a name="line239"></a>                - database (handled internally by API)
<a name="line240"></a>                - system (handled internally by API)
<a name="line241"></a>        */</span>
<a name="line242"></a>&nbsp;
<a name="line243"></a>        <span style="color: #000088;">$fullArgumentList</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/func_get_args"><span style="color: #990000;">func_get_args</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a name="line244"></a>&nbsp;
<a name="line245"></a>        <span style="color: #000088;">$standardArguments</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span>
<a name="line246"></a>                <span style="color: #0000ff;">'key'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$key</span><span style="color: #339933;">,</span>
<a name="line247"></a>                <span style="color: #0000ff;">'domain'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$domain</span>
<a name="line248"></a>        <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a name="line249"></a>&nbsp;
<a name="line250"></a>        <span style="color: #000088;">$arguments</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">buildArguments</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$standardArguments</span><span style="color: #339933;">,</span> <span style="color: #000088;">$fullArgumentList</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a name="line251"></a>&nbsp;
<a name="line252"></a>        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">write</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'hostingaccount/terminate/'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$arguments</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">wasSuccessful</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a name="line253"></a>    <span style="color: #009900;">&#125;</span>
<a name="line254"></a>&nbsp;
<a name="line255"></a>&nbsp;
<a name="line256"></a>    <span style="color: #009933; font-style: italic;">/**
<a name="line257"></a>     * @link http://api.hostingreborn.com/docs/functions/hostingaccounts/add/
<a name="line258"></a>     *
<a name="line259"></a>     * @param string $key
<a name="line260"></a>     * @param string $domain
<a name="line261"></a>     * @param string $username
<a name="line262"></a>     * @param int $storageLimit
<a name="line263"></a>     * @param int $bandwidthLimit
<a name="line264"></a>     * @return array
<a name="line265"></a>     */</span>
<a name="line266"></a>    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> add<span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">NULL</span><span style="color: #339933;">,</span> <span style="color: #000088;">$domain</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">NULL</span><span style="color: #339933;">,</span> <span style="color: #000088;">$username</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">NULL</span><span style="color: #339933;">,</span> <span style="color: #000088;">$storageLimit</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">NULL</span><span style="color: #339933;">,</span> <span style="color: #000088;">$bandwidthLimit</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">NULL</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<a name="line267"></a>        <span style="color: #666666; font-style: italic;">/*
<a name="line268"></a>            Exceptions thrown by API:
<a name="line269"></a>                - database (handled internally by API)
<a name="line270"></a>                - system (handled internally by API)
<a name="line271"></a>                - service
<a name="line272"></a>                  - 100: User name invalid
<a name="line273"></a>                  - 101: Domain name invalid
<a name="line274"></a>                  - 102: Domain name taken
<a name="line275"></a>                  - 103: User name taken
<a name="line276"></a>                  - 104: No working servers found
<a name="line277"></a>                  - 105: All servers have reached their storage limits
<a name="line278"></a>        */</span>
<a name="line279"></a>&nbsp;
<a name="line280"></a>        <span style="color: #000088;">$arguments</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span>
<a name="line281"></a>                <span style="color: #0000ff;">'key'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$key</span><span style="color: #339933;">,</span>
<a name="line282"></a>                <span style="color: #0000ff;">'domain'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$domain</span><span style="color: #339933;">,</span>
<a name="line283"></a>                <span style="color: #0000ff;">'username'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$username</span><span style="color: #339933;">,</span>
<a name="line284"></a>                <span style="color: #0000ff;">'storage_limit'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$storageLimit</span><span style="color: #339933;">,</span>
<a name="line285"></a>                <span style="color: #0000ff;">'bandwidth_limit'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$bandwidthLimit</span>
<a name="line286"></a>        <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a name="line287"></a>&nbsp;
<a name="line288"></a>        <span style="color: #000088;">$collectionProperties</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span>
<a name="line289"></a>                <span style="color: #0000ff;">'/add_hosting_account_result/service_creation/password'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'password'</span><span style="color: #339933;">,</span>
<a name="line290"></a>                <span style="color: #0000ff;">'/add_hosting_account_result/storage_limit/status'</span> <span style="color: #339933;">=&gt;</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span>
<a name="line291"></a>                        <span style="color: #0000ff;">'index'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'storageLimitResult'</span><span style="color: #339933;">,</span>
<a name="line292"></a>                        <span style="color: #0000ff;">'type'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'bool'</span>
<a name="line293"></a>                <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<a name="line294"></a>                <span style="color: #0000ff;">'/add_hosting_account_result/storage_limit/value'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'storageLimitSet'</span><span style="color: #339933;">,</span>
<a name="line295"></a>                <span style="color: #0000ff;">'/add_hosting_account_result/bandwidth_limit/status'</span> <span style="color: #339933;">=&gt;</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span>
<a name="line296"></a>                        <span style="color: #0000ff;">'index'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'bandwidthLimitResult'</span><span style="color: #339933;">,</span>
<a name="line297"></a>                        <span style="color: #0000ff;">'type'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'bool'</span>
<a name="line298"></a>                <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<a name="line299"></a>                <span style="color: #0000ff;">'/add_hosting_account_result/bandwidth_limit/value'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'bandwidthLimitSet'</span>
<a name="line300"></a>        <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a name="line301"></a>&nbsp;
<a name="line302"></a>        try <span style="color: #009900;">&#123;</span>
<a name="line303"></a>            <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">write</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'hostingaccounts/add/'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$arguments</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getCollection</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$collectionProperties</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a name="line304"></a>        <span style="color: #009900;">&#125;</span> catch <span style="color: #009900;">&#40;</span>HR_apiResponseUnhandledException <span style="color: #000088;">$e</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<a name="line305"></a>            <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handleApiResponseUnhandledException</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$e</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a name="line306"></a>        <span style="color: #009900;">&#125;</span>
<a name="line307"></a>&nbsp;
<a name="line308"></a>    <span style="color: #009900;">&#125;</span>
<a name="line309"></a>&nbsp;
<a name="line310"></a>&nbsp;
<a name="line311"></a>    <span style="color: #009933; font-style: italic;">/**
<a name="line312"></a>     * @link http://api.hostingreborn.com/docs/functions/hostingaccounts/list/
<a name="line313"></a>     *
<a name="line314"></a>     * @param string $key
<a name="line315"></a>     * @param bool $excludeDeleted
<a name="line316"></a>     * @return array
<a name="line317"></a>     */</span>
<a name="line318"></a>    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getList<span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">NULL</span><span style="color: #339933;">,</span> <span style="color: #000088;">$excludeDeleted</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<a name="line319"></a>        <span style="color: #666666; font-style: italic;">/*
<a name="line320"></a>            Exceptions thrown by API:
<a name="line321"></a>                - database (handled internally by API)
<a name="line322"></a>                - system (handled internally by API)
<a name="line323"></a>                - access (invalid key, handled internally by API)
<a name="line324"></a>        */</span>
<a name="line325"></a>&nbsp;
<a name="line326"></a>        <span style="color: #000088;">$fullArgumentList</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/func_get_args"><span style="color: #990000;">func_get_args</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a name="line327"></a>&nbsp;
<a name="line328"></a>        <span style="color: #000088;">$standardArguments</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span>
<a name="line329"></a>                <span style="color: #0000ff;">'key'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$key</span><span style="color: #339933;">,</span>
<a name="line330"></a>                <span style="color: #0000ff;">'exclude_deleted'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$excludeDeleted</span> <span style="color: #339933;">===</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span> ? <span style="color: #0000ff;">'true'</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">'false'</span>
<a name="line331"></a>        <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a name="line332"></a>&nbsp;
<a name="line333"></a>        <span style="color: #000088;">$queryString</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">buildQueryString</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$standardArguments</span><span style="color: #339933;">,</span> <span style="color: #000088;">$fullArgumentList</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a name="line334"></a>&nbsp;
<a name="line335"></a>        <span style="color: #000088;">$hostingAccounts</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">read</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'hostingaccounts/list/?'</span><span style="color: #339933;">.</span><span style="color: #000088;">$queryString</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getSet</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/hostingaccounts/hostingaccount'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a name="line336"></a>        <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$hostingAccounts</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$index</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$hostingAccount</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<a name="line337"></a>            <span style="color: #000088;">$hostingAccounts</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$index</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$hostingAccount</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getCollection</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">hostingAccountCollectionProperties</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a name="line338"></a>        <span style="color: #009900;">&#125;</span>
<a name="line339"></a>&nbsp;
<a name="line340"></a>        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$hostingAccounts</span><span style="color: #339933;">;</span>
<a name="line341"></a>    <span style="color: #009900;">&#125;</span>
<a name="line342"></a>&nbsp;
<a name="line343"></a>    <span style="color: #666666; font-style: italic;">/***************************************************************************/</span>
<a name="line344"></a>    <span style="color: #666666; font-style: italic;">/* Private methods                                                         */</span>
<a name="line345"></a>    <span style="color: #666666; font-style: italic;">/***************************************************************************/</span>
<a name="line346"></a>&nbsp;
<a name="line347"></a>    <span style="color: #009933; font-style: italic;">/**
<a name="line348"></a>     *
<a name="line349"></a>     * @throws HR_apiHostingAccountException
<a name="line350"></a>     * @param HR_apiResponseUnhandledException $exception
<a name="line351"></a>     */</span>
<a name="line352"></a>    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">function</span> handleApiResponseUnhandledException<span style="color: #009900;">&#40;</span>HR_apiResponseUnhandledException <span style="color: #000088;">$exception</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<a name="line353"></a>        <span style="color: #b1b100;">switch</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$exception</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getApiExceptionType</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<a name="line354"></a>            <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'hostingaccount'</span><span style="color: #339933;">:</span>
<a name="line355"></a>                <span style="color: #b1b100;">switch</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$exception</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getApiExceptionCode</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<a name="line356"></a>                    <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'100'</span><span style="color: #339933;">:</span>
<a name="line357"></a>                        <span style="color: #000088;">$exceptionMessage</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'User name invalid'</span><span style="color: #339933;">;</span>
<a name="line358"></a>                        <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
<a name="line359"></a>&nbsp;
<a name="line360"></a>                    <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'101'</span><span style="color: #339933;">:</span>
<a name="line361"></a>                        <span style="color: #000088;">$exceptionMessage</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Domain name invalid'</span><span style="color: #339933;">;</span>
<a name="line362"></a>                        <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
<a name="line363"></a>&nbsp;
<a name="line364"></a>                    <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'102'</span><span style="color: #339933;">:</span>
<a name="line365"></a>                        <span style="color: #000088;">$exceptionMessage</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Domain name taken'</span><span style="color: #339933;">;</span>
<a name="line366"></a>                        <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
<a name="line367"></a>&nbsp;
<a name="line368"></a>                    <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'103'</span><span style="color: #339933;">:</span>
<a name="line369"></a>                        <span style="color: #000088;">$exceptionMessage</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'User name taken'</span><span style="color: #339933;">;</span>
<a name="line370"></a>                        <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
<a name="line371"></a>&nbsp;
<a name="line372"></a>                    <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'104'</span><span style="color: #339933;">:</span>
<a name="line373"></a>                        <span style="color: #000088;">$exceptionMessage</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'No working servers found'</span><span style="color: #339933;">;</span>
<a name="line374"></a>                        <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
<a name="line375"></a>&nbsp;
<a name="line376"></a>                    <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'105'</span><span style="color: #339933;">:</span>
<a name="line377"></a>                        <span style="color: #000088;">$exceptionMessage</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'All servers have reached their storage limits'</span><span style="color: #339933;">;</span>
<a name="line378"></a>                        <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
<a name="line379"></a>&nbsp;
<a name="line380"></a>                    <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'201'</span><span style="color: #339933;">:</span>
<a name="line381"></a>                        <span style="color: #000088;">$exceptionMessage</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'action failed as hosting account is suspended'</span><span style="color: #339933;">;</span>
<a name="line382"></a>                        <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
<a name="line383"></a>&nbsp;
<a name="line384"></a>                    <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'200'</span><span style="color: #339933;">:</span>
<a name="line385"></a>                        <span style="color: #000088;">$exceptionMessage</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'password reset failed'</span><span style="color: #339933;">;</span>
<a name="line386"></a>                        <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
<a name="line387"></a>                <span style="color: #009900;">&#125;</span>
<a name="line388"></a>&nbsp;
<a name="line389"></a>                <span style="color: #b1b100;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> HR_apiHostingAccountException<span style="color: #009900;">&#40;</span><span style="color: #000088;">$exceptionMessage</span><span style="color: #339933;">,</span> <span style="color: #000088;">$exception</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getApiExceptionCode</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a name="line390"></a>&nbsp;
<a name="line391"></a>                <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
<a name="line392"></a>&nbsp;
<a name="line393"></a>            <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'account'</span><span style="color: #339933;">:</span>
<a name="line394"></a>                <span style="color: #b1b100;">switch</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$exception</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getApiExceptionCode</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<a name="line395"></a>                    <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'101'</span><span style="color: #339933;">:</span>
<a name="line396"></a>                        <span style="color: #000088;">$exceptionMessage</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'action disallowed - account overdrawn'</span><span style="color: #339933;">;</span>
<a name="line397"></a>                        <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
<a name="line398"></a>                <span style="color: #009900;">&#125;</span>
<a name="line399"></a>&nbsp;
<a name="line400"></a>                <span style="color: #b1b100;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> HR_apiAccountException<span style="color: #009900;">&#40;</span><span style="color: #000088;">$exceptionMessage</span><span style="color: #339933;">,</span> <span style="color: #000088;">$exception</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getApiExceptionCode</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a name="line401"></a>&nbsp;
<a name="line402"></a>                <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
<a name="line403"></a>        <span style="color: #009900;">&#125;</span>       
<a name="line404"></a>&nbsp;
<a name="line405"></a>    <span style="color: #009900;">&#125;</span>
<a name="line406"></a>&nbsp;
<a name="line407"></a><span style="color: #009900;">&#125;</span>
<a name="line408"></a>&nbsp;
<a name="line409"></a><span style="color: #000000; font-weight: bold;">?&gt;</span></pre>
<div class="header">
<h1>Hosting Reborn API PHP Library</h1>
<ul>
<li><a href="../overview-summary.html">Overview</a></li>
<li>Package</li><li>Class</li><li>Tree</li><li><a href="../overview-files.html">Files</a></li>
<li><a href="../deprecated-list.html">Deprecated</a></li>
<li><a href="../index-all.html">Index</a></li>
</ul>
</div>

<div class="small_links">
<a href="../index.html" target="_top">Frames</a>
<a href="../source/hr_hostingaccountapi.class.php.html" target="_top">No frames</a>
</div>
<hr>

<p id="footer">This document was generated by <a href="http://peej.github.com/phpdoctor/">PHPDoctor: The PHP Documentation Creator</a></p>

</body>

</html>